<?
    /*
     * Destination
     */
    $dest_hot = lang('form.dest_region');

    if (isset($_GET['dest_hot']) && ($_GET['dest_hot'] != -1 ) && ($_GET['dest_hot'] != "" ))
        $dest_hot = $_GET['dest_hot'];

    /*
     * Checkin, Checkout
     */
    $check_in = date('d.m.Y', strtotime("+1 day"));

    if (isset($_GET['check_in']))
        $check_in = $_GET['check_in'];

    $check_out = date('d.m.Y', strtotime("+2 day"));

    if (isset($_GET['check_out']))
        $check_out = $_GET['check_out'];

    /*
     * Number persons
     */
    $sel_text = 'selected = "selected"';

    if (isset($_GET['nr_adults'])) {
        $selected = $_GET['nr_adults'];
        $cnt = (isset($_GET['acc_type']) && $_GET['acc_type'] == 'hotel') ? 5 : 12;
    } else if (isset($_GET['acc_type']) && $_GET['acc_type'] == 'hotel') {
        $selected = 2;
        $cnt = 5;
    } else {
        $selected = 2;
        $cnt = 5;
    }
?>


<div id="form">

    <form action="<?= lang_url('search') ?>" method="get" id="search_form" class='form_<?= $this->lang->mci_current() ?>'>


       

        <h3><?= lang('form.acc_search'); ?></h3>

        <div>
            <label for="dest_hot"><?= lang('form.destination_name'); ?></label>
            <div class="input clearfix">
                <input type="text" value="<?= $dest_hot ?>" name="dest_hot" id="dest_hot" />
            </div>
        </div>

        <div class="clearfix">
            <div class="form_col">
                <label for="check_in"><?= lang('form.checkin'); ?></label>
                <div class="input clearfix">
                    <input type="text" value="<?= $check_in ?>" name="check_in" id="check_in" class="checkinout" />
                </div>
            </div>
            <div class="form_col">
                <label for="check_out"><?= lang('form.checkout'); ?></label>
                <div class="input clearfix">
                    <input type="text" value="<?= $check_out ?>" name="check_out" id="check_out" class="checkinout"  />
                </div>
            </div>
        </div>

        <div>
            <input type="checkbox" value="" name="specific_date" id="specific_date" /> <?= lang('form.specific'); ?>
        </div>

        <div class="clearfix">
            <div class="right">
                <div class="form_col">
                    <label for="nr_adults"><?= lang('form.adults'); ?></label>
                    <div class="input">
                        <select name="nr_adults" id="nr_adults" class='dropdownized'>
                            <? for ($index = 1; $index <= $cnt; $index++): ?>
                                    <option value = "<?= $index ?>" <? if ($selected == $index) echo $sel_text; ?>><?= $index ?> </option>
                                <? endfor; ?>
                        </select>
                    </div>
                </div>
                <div class="form_col">
                    <label for="nr_childrens"><?= lang('form.childrens'); ?></label>
                    <div class="input">
                        <select name="nr_childrens" id="nr_childrens" class='dropdownized'>
                            <option value="0" selected='selected'>0</option>
                            <option value="1">1</option>
                            <option value="2">2</option>
                            <option value="3">3</option>
                            <option value="4">4</option>
                            <option value="5">5</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>

        <div>
            <div class="best-prices">
                <span><?= lang('best.best'); ?></span>
            </div>
             <? if (isset($_GET['currency'])): ?>
                <input type="hidden" value="<?= $_GET['currency'] ?>" name="currency">
            <? endif; ?>

            <input type="submit" class="button" value="<?= lang('form.search'); ?>">
        </div>

    </form>

</div>